package com.service;

import com.mapper.ItemMapper;
import com.mapper.UserMapper;
import com.entity.UserInfo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import javax.annotation.Resource;
@Service
public class ItemService {
    @Resource
    private ItemMapper itemMapper;
    //投票
    @Transactional(rollbackFor = {Exception.class,RuntimeException.class})
    public Integer vote(Integer[]  vopids,Integer vsid,Integer userid){
    	int temp = 0 ;
    	for(int i = 0 ; i < vopids.length; i++) {
    		temp = itemMapper.ItemVote(vopids[i], vsid, userid);	  
    	}
       return  temp ; 
    }
    
    public Integer selectItemInfoByUserId(Integer id) {

    	return this.itemMapper.selectItemByUserid(id);

    }
  
}
